<?php
/*
 * @Author: Wulala
 * @Date: 2025-03-29 13:50:28
 * @LastEditTime: 2025-04-03 11:41:32
 * @LastEditors: Wulala
 * @Description: 
 * @FilePath: \yoshop\app\api\model\AppinfoAppConfig.php
 * 可以输入预定的版权声明、个性签名、空行等
 */
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务，帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件，不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types=1);

namespace app\api\model;

use cores\exception\BaseException;
use app\common\model\AppinfoAppConfig as AppinfoAppConfigModel;
use think\facade\Db;
use app\common\service\ExchangeService;

/**
 * 应用信息
 * Class Article
 * @package app\api\model
 */
class AppinfoAppConfig extends AppinfoAppConfigModel
{

     // 查询应用信息
    public function getAppInfo($data)
    {
        if (!isset($data['appid']) || $data['appid'] == '') {
            $this->error = '请传入应用的appid';
            return false;
        }

        $appInfo=ExchangeService::getAppInfo($data['appid']);//获取app信息 
        if(!isset($appInfo["code"])||$appInfo["code"]!=1){
            $this->error = '查询应用信息失败';
            return false;
        }
        $appConfig=$appInfo['data']["app_config"];

        $data['points_rate']= $appConfig['points_rate'];//兑换汇率

        return $data;
    }
}